import {http} from "../utils/util";
const movie="movie/";
const subject="movie/subject/";
const search="movie/search?q=";
class MovieModel extends http{
    getTop250(callback){
        this.request({
            url:movie+"top250",
            success:res=>{
                callback(res)
            }
        })
    }
    getComingsoon(callback){
        this.request({
            url:movie+"coming_soon",
            success:res=>{
                callback(res)
            }
        })
    }
    getIntheaters(callback){
        this.request({
            url:movie+"in_theaters",
            success:res=>{
                callback(res)
            }
        })
    }
    getUsbox(callback){
        this.request({
            url:movie+"us_box",
            success:res=>{
                callback(res)
            }
        })
    }
    getsubject(keyword,callback){
        this.request({
            url:subject+keyword,
            success:res=>{
                callback(res)
            }
        })
    }
    getSearch(keyword,callback){
        this.request({
            url:search+keyword,
            success:res=>{
                callback(res)
            }
        })
    }
}
export {MovieModel}